<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>客户端页面</title>
    <script src="https://cdn.bootcss.com/socket.io/2.3.0/socket.io.dev.js"></script>
</head>
<body>
<textarea type="text" id="message">

</textarea>
<input type="button" value="清除" onclick="f_delete()">
<script>
    var socket = io.connect('http://127.0.0.1:3000');
    socket.on('push message',function(data){
        document.getElementById('message').value=data.text;
    });
    function f_delete(){
        document.getElementById('message').value='';
    }
</script>

</body>
</html>